Skip to content

Support confirmation of move instance method refactoring errors - #3862

Open
shin19991207 wants to merge 1 commit into
eclipse-jdtls:mainfrom
shin19991207:fix-vscode-java-4460
Open

Support confirmation of move instance method refactoring errors#3862
shin19991207 wants to merge 1 commit into
eclipse-jdtls:mainfrom
shin19991207:fix-vscode-java-4460

Conversation

@shin19991207

@shin19991207 shin19991207 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Related to redhat-developer/vscode-java#4460

This PR adds support for confirming non-fatal problems reported while creating a "Move Instance Method" refactoring.

JDT LS previously had no way to represent this intermediate state. A refactoring response could contain a workspace edit or an error, but it could not indicate that non-fatal problems had been found and allow the client to ask the user whether to proceed, as is supported in Eclipse IDE.

When "Move Instance Method" reports non-fatal errors, JDT LS now returns an indication that the operation can continue and an opaque confirmation token, with the reported error messages and no workspace edit. The client can display the problems and repeat the move request with the token after the user confirms the operation.

RefactoringConfirmation generates the token from the checked operation and its relevant inputs. On the confirmed request, JDT LS recalculates the token and returns the workspace edit only if the refactoring context still matches what the user reviewed. If the source or reported conditions have changed, JDT LS rejects the confirmation and requires the client to run the refactoring again. (The confirmation token utility was implemented with assistance from Codex)

Fatal problems remain blocking and cannot be confirmed.

Tested together with redhat-developer/vscode-java#4482

Signed-off-by: Morgan Chang <shin19991207@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant